package com.leo.foodmaster.commons.constants;


/**
 * <p>
 * 授权认证常量
 * </p>
 *
 * @author ：Leo
 * @since ：2021-06-18 11:10
 */
public final class AuthConstants {
    private AuthConstants(){}

    /**
     * 角色前缀
     */
    public static final String ROLE = "ROLE_";

    /**
     * 验证码 redis key
     */
    public static final String CAPTCHA_CODE_KEY = "captcha_codes:";

    /**
     * 用户名
     */
    public static final String USER_INFO = "userInfo";

    /**
     * 令牌标识
     */
    public static final String JWT_HEADER = "Authorization";

    /**
     * 令牌秘钥
     */
    public static final String JWT_SECRET = "123456";

    /**
     * 令牌过期时间（单位/毫秒）
     */
    public static final int JWT_EXPIRE_TIME = 1000 * 60 * 60 * 24;

    /**
     * token前缀
     */
    public static final String JWT_PREFIX = "Bearer ";

    /**
     * Redis缓存权限规则key
     */
    public static final String PERMISSION_ROLES_KEY = "system:permission:roles";

    /**
     * 黑名单token前缀
     */
    public static final String TOKEN_BLACKLIST_PREFIX = "system:token:blacklist:";

    /**
     * 验证码类型数组计算
     */
    public static final String CAPTCHA_TYPE_MATH = "math";

    /**
     * 验证码有效期（分钟）
     */
    public static final Integer CAPTCHA_EXPIRATION = 2;

    /**
     * 字典管理 cache key
     */
    public static final String SYS_DICT_KEY = "sys_dict:";

}
